
#include "../app_main/app_def.h"


/**
  * @brief   This function handles NMI exception.
  * @param  None
  * @retval None
  */
void stm32f103x_app_int_handler_NMI(void){
}

/**
  * @brief  This function handles Hard Fault exception.
  * @param  None
  * @retval None
  */
void stm32f103x_app_int_handler_HardFault(void){
  /* Go to infinite loop when Hard Fault exception occurs */
  while (1){
  }
}

/**
  * @brief  This function handles Memory Manage exception.
  * @param  None
  * @retval None
  */
void stm32f103x_app_int_handler_MemManage(void){
  /* Go to infinite loop when Memory Manage exception occurs */
  while (1){
  }
}

/**
  * @brief  This function handles Bus Fault exception.
  * @param  None
  * @retval None
  */
void stm32f103x_app_int_handler_BusFault(void){
  /* Go to infinite loop when Bus Fault exception occurs */
  while (1){
  }
}

/**
  * @brief  This function handles Usage Fault exception.
  * @param  None
  * @retval None
  */
void stm32f103x_app_int_handler_UsageFault(void){
  /* Go to infinite loop when Usage Fault exception occurs */
  while (1){

  }
}

/**
  * @brief  This function handles SVCall exception.
  * @param  None
  * @retval None
  */
void stm32f103x_app_int_handler_SVC(void)
{
}

/**
  * @brief  This function handles Debug Monitor exception.
  * @param  None
  * @retval None
  */

void stm32f103x_app_int_handler_DebugMon(){
}


/*
*********************************************************************************************************
*                                            LOCAL TABLES
*********************************************************************************************************
*/


/*
*********************************************************************************************************
*                                       LOCAL GLOBAL VARIABLES
*********************************************************************************************************
*/


/*
*********************************************************************************************************
*                                      LOCAL FUNCTION PROTOTYPES
*********************************************************************************************************
*/

#ifdef WT_IAR_603

typedef  union {
    CPU_FNCT_VOID   Fnct;
    unsigned long   ul_ptr;
} APP_INTVECT_ELEM;

extern  void  __iar_program_start(void);

static unsigned long pulStack[256] @ ".noinit"; //256 the old value
/*
*********************************************************************************************************
*                                     LOCAL CONFIGURATION ERRORS
*********************************************************************************************************
*/

/*
*********************************************************************************************************
*                                  EXCEPTION / INTERRUPT VECTOR TABLE
*
* Note(s) : (1) The Cortex-M3 may have up to 256 external interrupts, which are the final entries in the
*               vector table.  The STM32 has 48 external interrupt vectors.
*********************************************************************************************************
*/

__root  const  APP_INTVECT_ELEM  __vector_table[] @ ".intvec" = {
    { .ul_ptr = (unsigned long)pulStack + sizeof(pulStack) },
    __iar_program_start,														/*  1, PC start value.                                  */
    stm32f103x_app_int_handler_NMI,                                             /*  2, NMI.                                             */
    stm32f103x_app_int_handler_HardFault,                                       /*  3, Hard Fault.                                      */
    stm32f103x_app_int_handler_MemManage,                                       /*  4, Memory Management.                               */
    stm32f103x_app_int_handler_BusFault,                                        /*  5, Bus Fault.                                       */
    stm32f103x_app_int_handler_UsageFault,                                      /*  6, Usage Fault.                                     */
    0,																		    /*  7, Reserved.                                        */
    0,																			/*  8, Reserved.                                        */
    0,																			/*  9, Reserved.                                        */
    0,																			/* 10, Reserved.                                        */
    stm32f103x_app_int_handler_SVC,												/* 11, SVCall.                                          */
    stm32f103x_app_int_handler_DebugMon,                                        /* 12, Debug Monitor.                                   */
    0,																			/* 13, Reserved.                                        */
    OS_CPU_PendSVHandler,														/* 14, PendSV Handler.                                  */
    OS_CPU_SysTickHandler,														/* 15, uC/OS-II Tick ISR Handler.                       */

    stm32f103x_bsp_int_handler_WWDG,                                         /* 16, INTISR[  0]  Window Watchdog.                    */
    stm32f103x_bsp_int_handler_PVD,                                          /* 17, INTISR[  1]  PVD through EXTI Line Detection.    */
    stm32f103x_bsp_int_handler_TAMPER,                                       /* 18, INTISR[  2]  Tamper Interrupt.                   */
    stm32f103x_bsp_int_handler_RTC,                                          /* 19, INTISR[  3]  RTC Global Interrupt.               */
    stm32f103x_bsp_int_handler_FLASH,                                        /* 20, INTISR[  4]  FLASH Global Interrupt.             */
    stm32f103x_bsp_int_handler_RCC,                                          /* 21, INTISR[  5]  RCC Global Interrupt.               */
    stm32f103x_bsp_int_handler_EXTI0,                                        /* 22, INTISR[  6]  EXTI Line0 Interrupt.               */
    stm32f103x_bsp_int_handler_EXTI1,                                        /* 23, INTISR[  7]  EXTI Line1 Interrupt.               */
    stm32f103x_bsp_int_handler_EXTI2,                                        /* 24, INTISR[  8]  EXTI Line2 Interrupt.               */
    stm32f103x_bsp_int_handler_EXTI3,                                        /* 25, INTISR[  9]  EXTI Line3 Interrupt.               */
    stm32f103x_bsp_int_handler_EXTI4,                                        /* 26, INTISR[ 10]  EXTI Line4 Interrupt.               */
    stm32f103x_bsp_int_handler_DMA1_CH1,                                     /* 27, INTISR[ 11]  DMA Channel1 Global Interrupt.      */
    stm32f103x_bsp_int_handler_DMA1_CH2,                                     /* 28, INTISR[ 12]  DMA Channel2 Global Interrupt.      */
    stm32f103x_bsp_int_handler_DMA1_CH3,                                     /* 29, INTISR[ 13]  DMA Channel3 Global Interrupt.      */
    stm32f103x_bsp_int_handler_DMA1_CH4,                                     /* 30, INTISR[ 14]  DMA Channel4 Global Interrupt.      */
    stm32f103x_bsp_int_handler_DMA1_CH5,                                     /* 31, INTISR[ 15]  DMA Channel5 Global Interrupt.      */

    stm32f103x_bsp_int_handler_DMA1_CH6,                                     /* 32, INTISR[ 16]  DMA Channel6 Global Interrupt.      */
    stm32f103x_bsp_int_handler_DMA1_CH7,                                     /* 33, INTISR[ 17]  DMA Channel7 Global Interrupt.      */
    stm32f103x_bsp_int_handler_ADC1_2,                                       /* 34, INTISR[ 18]  ADC1 & ADC2 Global Interrupt.       */
    stm32f103x_bsp_int_handler_USB_HP_CAN_TX,                                      /* 35, INTISR[ 19]  USB High Prio / CAN TX  Interrupts. */
    stm32f103x_bsp_int_handler_USB_LP_CAN_RX0,                                     /* 36, INTISR[ 20]  USB Low  Prio / CAN RX0 Interrupts. */
    stm32f103x_bsp_int_handler_CAN_RX1,                                     /* 37, INTISR[ 21]  CAN RX1 Interrupt.                  */
    stm32f103x_bsp_int_handler_CAN_SCE,                                     /* 38, INTISR[ 22]  CAN SCE Interrupt.                  */
    stm32f103x_bsp_int_handler_EXTI9_5,                                      /* 39, INTISR[ 23]  EXTI Line[9:5] Interrupt.           */
    stm32f103x_bsp_int_handler_TIM1_BRK,                                     /* 40, INTISR[ 24]  TIM1 Break  Interrupt.              */
    stm32f103x_bsp_int_handler_TIM1_UP,                                      /* 41, INTISR[ 25]  TIM1 Update Interrupt.              */
    stm32f103x_bsp_int_handler_TIM1_TRG_COM,                                 /* 42, INTISR[ 26]  TIM1 Trig & Commutation Interrupts. */
    stm32f103x_bsp_int_handler_TIM1_CC,                                      /* 43, INTISR[ 27]  TIM1 Capture Compare Interrupt.     */
    stm32f103x_bsp_int_handler_TIM2,                                         /* 44, INTISR[ 28]  TIM2 Global Interrupt.              */
    stm32f103x_bsp_int_handler_TIM3,                                         /* 45, INTISR[ 29]  TIM3 Global Interrupt.              */
    stm32f103x_bsp_int_handler_TIM4,                                         /* 46, INTISR[ 30]  TIM4 Global Interrupt.              */
    stm32f103x_bsp_int_handler_I2C1_EV,                                      /* 47, INTISR[ 31]  I2C1 Event  Interrupt.              */
    stm32f103x_bsp_int_handler_I2C1_ER,                                      /* 48, INTISR[ 32]  I2C1 Error  Interrupt.              */
    stm32f103x_bsp_int_handler_I2C2_EV,                                      /* 49, INTISR[ 33]  I2C2 Event  Interrupt.              */
    stm32f103x_bsp_int_handler_I2C2_ER,                                      /* 50, INTISR[ 34]  I2C2 Error  Interrupt.              */
    stm32f103x_bsp_int_handler_SPI1,                                         /* 51, INTISR[ 35]  SPI1 Global Interrupt.              */
    stm32f103x_bsp_int_handler_SPI2,                                         /* 52, INTISR[ 36]  SPI2 Global Interrupt.              */
    stm32f103x_bsp_int_handler_USART1,                                       /* 53, INTISR[ 37]  USART1 Global Interrupt.            */
    stm32f103x_bsp_int_handler_USART2,                                       /* 54, INTISR[ 38]  USART2 Global Interrupt.            */
    stm32f103x_bsp_int_handler_USART3,                                       /* 55, INTISR[ 39]  USART3 Global Interrupt.            */
    stm32f103x_bsp_int_handler_EXTI15_10,                                    /* 56, INTISR[ 40]  EXTI Line [15:10] Interrupts.       */
    stm32f103x_bsp_int_handler_RTCAlarm,                                     /* 57, INTISR[ 41]  RTC Alarm EXT Line Interrupt.       */
    stm32f103x_bsp_int_handler_USBWakeUp,                                    /* 58, INTISR[ 42]  USB Wakeup from Suspend EXTI Int.   */
	stm32f103x_bsp_int_handler_TIM8_BRK,
	stm32f103x_bsp_int_handler_TIM8_UP,
	stm32f103x_bsp_int_handler_TIM8_TRG_COM,
	stm32f103x_bsp_int_handler_TIM8_CC,
	stm32f103x_bsp_int_handler_ADC3,
	stm32f103x_bsp_int_handler_FSMC,
	stm32f103x_bsp_int_handler_SDIO,
	stm32f103x_bsp_int_handler_TIM5,
	stm32f103x_bsp_int_handler_SPI3,
	stm32f103x_bsp_int_handler_UART4,
	stm32f103x_bsp_int_handler_UART5,
	stm32f103x_bsp_int_handler_TIM6,
	stm32f103x_bsp_int_handler_TIM7,
	stm32f103x_bsp_int_handler_DMA2_CH1,
	stm32f103x_bsp_int_handler_DMA2_CH2,
	stm32f103x_bsp_int_handler_DMA2_CH3,
	stm32f103x_bsp_int_handler_DMA2_CH4_5,
 
};
#endif
